package com.ia2014.tp.portal2.entities;

import javax.persistence.Column;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.Transient;

import com.ia2014.tp.portal2.vo.ModuloVO;
import com.ia2014.tp.portal2.vo.ModuloLogisticaVO;
import com.ia2014.tp.portal2.enums.ModulosEnum;

/**
 * Representa un Modulo del Tipo Logistica
 * @author Ignacio Iljin
 *
 */
@Entity
@DiscriminatorValue("logistica")
public class ModuloLogistica extends Modulo {

	@Column(columnDefinition="bit")
	private Boolean sincronico;
	
	@Column
	private String url;
	
	@Column
	private String colaJMS;
	
	@Column
	private String userJMS;
	
	@Column
	private String passJMS;
	
	public ModuloLogistica() {
		// TODO Auto-generated constructor stub
	}

	public Boolean getSincronico() {
		return sincronico;
	}

	public void setSincronico(Boolean sincronico) {
		this.sincronico = sincronico;
	}

	@Override
	public String toString() {
		return "Logistica [sincronico=" + sincronico + "]";
	}
	
	
	
	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public String getColaJMS() {
		return colaJMS;
	}

	public void setColaJMS(String colaJMS) {
		this.colaJMS = colaJMS;
	}

		
	public String getUserJMS() {
		return userJMS;
	}

	public void setUserJMS(String userJMS) {
		this.userJMS = userJMS;
	}

	public String getPassJMS() {
		return passJMS;
	}

	public void setPassJMS(String passJMS) {
		this.passJMS = passJMS;
	}

	@Transient
	@Override
	public ModuloLogisticaVO getVO() {
		ModuloLogisticaVO moduloLogisticaVO = (ModuloLogisticaVO) super.getVO();
		
		moduloLogisticaVO.setSincronico(sincronico);
		
		return moduloLogisticaVO;
	}

	@Transient
	@Override
	public void setVO(ModuloVO abstractVO) {
		
		ModuloLogisticaVO moduloLogisticaVO = abstractVO.getModuloLogisticaVO();
		
		super.setVO(moduloLogisticaVO);
		
	}

	@Transient
	@Override
	protected ModuloLogisticaVO getVOInstance() {
		
		return new ModuloLogisticaVO();
	}

	@Transient
	@Override
	public boolean isModuloDeposito() {
		// TODO Auto-generated method stub
		return false;
	}

	@Transient
	@Override
	public boolean isModuloPortal() {
		// TODO Auto-generated method stub
		return false;
	}

	@Transient
	@Override
	public boolean isModuloDespacho() {
		// TODO Auto-generated method stub
		return false;
	}

	@Transient
	@Override
	public boolean isModuloLogistica() {
		// TODO Auto-generated method stub
		return true;
	}
	
	@Transient
	@Override
	public ModulosEnum getTipoModulo() {
		// TODO Auto-generated method stub
		return ModulosEnum.LOGISTICA;
	}
}
